/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: Pegasus  Date: 2019-02-20 Time: 23:25
 *
 * 加载中
 */

import React, {Component} from 'react';
import {
  View,
  Text,
  StyleSheet
} from 'react-native';
import LottieView from 'lottie-react-native';

export default class LoadingView extends Component {

  componentDidMount() {
    this.animation.play();
  }

  render() {
    return (
      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
        <View style={{height: 100, width: 150}}>
          <LottieView
            ref={animation => {
              this.animation = animation;
            }}
            style={[StyleSheet.absoluteFill]}
            source={require('../../resource/json/loading_1.json')}
            loop={true}
          />
        </View>
      </View>
    )
  }
}